#!/bin/bash
#杀掉java进程
kill $(ps aux | grep tomcat8 | grep -v grep | awk '{print $2}')

# 等待java进程结束
while true; do
have=$(netstat -anp | grep 80 -w | grep -v grep)
if [ -n "$have" ]; then
  sleep 5
else
  break
fi
done

# 删除旧的war包
rm /opt/tomcat8/webapps/ROOT* -rf                                    

